package work.base.data.json.fastjson;


import com.alibaba.fastjson.JSONObject;
import work.entity.User;

/**
 * @author shenminglong@kedacom.com
 * @date 2021-11-26
 *
 * alibaba.fastjson的使用
 */
public class FastJsonTest {

    public static void main(String[] args) {

        // JSON字符串 转 bean
        String s1 = "{\"id\":\"123456\",\"name\":\"sml\",\"age\":\"22\"}";
        User user = JSONObject.toJavaObject(JSONObject.parseObject(s1), User.class);
        System.out.println(user);
    }
}
